<script setup>
import TreeMenu from "./treeMenu.vue";
import { UseMenuStore } from "../store/index";
const usemenustore = UseMenuStore();
import { ref, computed } from "vue";
const menuData = computed(() => usemenustore.routerList);
const isCollapse = computed(() => usemenustore.isCollapse);

import { useRoute } from "vue-router";
const router = useRoute();
// menuData.value = router.matched[0].children;
// menuData.value = usemenustore.routerList;
// console.log(router);
// console.log(menuData.value);
const handleOpen = () => {};
const handleClose = () => {};
const active = usemenustore.MenuActive;
</script>

<template>
  <el-menu
    :style="{ width: !usemenustore.isCollapse ? '230px' : '64px' }"
    active-text-color="#ffd04b"
    background-color="#545c62"
    class="aside-container"
    text-color="#fff"
    @open="handleOpen"
    @close="handleClose"
    :collapse="usemenustore.isCollapse"
    :default-active="active"
  >
    <p class="logo-lg">{{ usemenustore.isCollapse ? "TT" : "TT陪诊" }}</p>

    <TreeMenu :menuData="menuData" :index="1" />
  </el-menu>
</template>

<style scoped lang="less">
.aside-container {
  height: 100%;
  .logo-lg {
    font-size: 20px;
    text-align: center;
    height: 50px;
    line-height: 50px;
    color: #fff;
  }
}
</style>
